import 'package:flutter/material.dart';
import 'package:part_time_job_pro/common/models/part_job_type.dart';
import 'package:part_time_job_pro/common/models/part_type_temp.dart';

class PartJobState {
  late Map<String, dynamic> errorMsg;

  //滚动条透明度 默认不显示
  double scrollBarThickness = 0;

  //名称最大输入
  int jobNameLength = 0;

  //职位名称
  late String jobName;

  //职位搜索
  late String jobSearchName;

  //新增职位
  late String addJobName;

  //所属地区
  late String countryText;

  //地区编码
  late String locationCode;

  //详细地址
  late String addressText;

  //工作内容
  late String workContent;

  //操作类型 选择/搜索
  late String operator;

  //分类数据
  late List<PartJobType> partTypeList;

  //一级分类数据
  late List<PartJobType> firstLevelList;

  //右侧数据
  late List<PartJobType> secondLevelList;

  //右侧二级数据
  late List<PartJobType> thirdLevelList;

  //搜索数据
  late List<PartJobType> searchDataList;

  //选中二级组件坐标
  Rect? secondCheckedRect;

  //选中的一级
  PartJobType? firstCheckedType;

  //选中的二级
  PartJobType? secondCheckedType;

  //选中的三级
  PartJobType? thirdCheckedType;

  //选中第几行
  late int checkedRowIndex;

  //选中的类型
  int? selectedPartTypeId;

  //模板类型名称
  String? tempPartTypeName;

  //选中的类型
  late String selectPartTypeText;

  //默认编辑内容
  late String hinTextValue;

  //选择的场景
  late String selectedScene;

  //分类模板数据
  late List<PartTypeTemp> partTypeTempList;

  //当前模板下标
  late int currentTempIndex;

  //当前显示的模板内容
  late String showTempContent;

  //是否显示下一个模板按钮
  late bool isShowNextButton;

  //是否显示下一步按钮
  late bool isShowNextStepButton;

  //是否显示搜索输入
  late bool isSearchInput;

  //是否显示添加完成按钮
  late bool isShowAddTypeBtn;
  //是否显示键盘
  late bool showKeyboard;

  PartJobState() {
    ///Initialize variables
    jobName = "";
    addJobName = "";
    operator = "select";
    jobSearchName = "";
    countryText = "";
    addressText = "";
    locationCode = "110000";
    searchDataList = [];
    partTypeList = [];
    firstLevelList = [];
    secondLevelList = [];
    thirdLevelList = [];
    partTypeTempList = [];
    checkedRowIndex = 0;
    currentTempIndex = 0;
    secondCheckedRect = null;
    selectedPartTypeId = 0;
    selectedScene = "0";
    tempPartTypeName = "";
    selectPartTypeText = "";
    workContent = "";
    showTempContent = "";
    isSearchInput = false;
    isShowNextButton = false;
    isShowNextStepButton = true;
    isShowAddTypeBtn = false;
    showKeyboard = true;

    hinTextValue = "【工资薪水】\n【工作内容】\n【上班时间】\n【工作地点】\n【工作要求】\n【其他福利】\n\n";
    errorMsg = {};
  }
}
